feat(toolbar): add ais.index block support for index-scoped widgets#26
Open
sarahdayan wants to merge 4 commits intofeat/ais-index-block-supportfrom
Open
feat(toolbar): add ais.index block support for index-scoped widgets#26sarahdayan wants to merge 4 commits intofeat/ais-index-block-supportfrom
ais.index block support for index-scoped widgets#26sarahdayan wants to merge 4 commits intofeat/ais-index-block-supportfrom
Conversation
ais.index block support for index-scoped widgets
6f94e8d to
2e4cd56
Compare
82f34f0 to
8a3e775
Compare
2e4cd56 to
d12d03c
Compare
8a3e775 to
db9e620
Compare
d12d03c to
ac3a2eb
Compare
Add nested block UI, auto-wrapping logic, move-between-indices support, and AI tool updates for the new `ais.index` block type. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…fix stale closure
- Render `icon` as JSX element (`{icon}`) instead of component (`<Icon />`)
- Pass `blocks` as parameter to `updateCssVariablesOnPage` to avoid stale
closure over `experience` state
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add tests for edge cases discovered during audit: - describeExperience: empty index blocks, unnamed index blocks - add_widget: container-in-parameters fallback, ais.index without params, ais.index doesn't require container - remove_widget: malformed path rejection - move_widget: non-existent nested path rejection Also fix Prettier formatting in toolbar.css. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
db9e620 to
1f687c0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds full toolbar support for
ais.indexblocks introduced in #25. Users can manage index-scoped widget hierarchies through both the manual UI and the AI assistant.Key changes:
ais.indexblocks (creates one if none exists, appends to the last one otherwise)BlockPath([parentIdx, childIdx]) instead of flat indicesIndexBlockGroupcomponent: grouped container showing index params + nested child widgets + scoped "Add Widget" button<select>dropdowntarget_indexvalidation,move_widgettool,parsePathhardening (rejects empty strings, negative indices, 3+ levels)AddBlockResultreturn type:onAddBlockreturns{ path, indexCreated }so the AI tool can prompt for index name without relying on stale React stateNote
No new widget was added (aside from
index). The preview images below used a dummysearchBoxwidget for manual tests, but this PR doesn't include it.Files changed
types.tsBlockPath,AddBlockResult, optionalcontainer,indexIdwidget-types.tsxais.indexentry,indexIndependentflag,columnsoptionapp.tsxonMoveBlock, helperspanel.tsxindex-block-group.tsxblock-card.tsxblock-editor.tsxcolumnsconfigadd-widget-popover.tsxfilterprop to excludeais.indexin scoped menusai/tools.tstarget_indexvalidation,move_widget,parsePathhardeningai/system-prompt.tsai-chat.tsxai-tools.test.tsPreview